from typing import Type, TypeVar, Generic, get_args

from config.database import Base

T = TypeVar('T', bound=Base)

class BaseDao(Generic[T]):
    """通用DAO基类"""
    @classmethod
    def get_model_class(cls) -> Type[T]:
        return get_args(cls.__orig_bases__[0])[0]
    